package com.xish.api.activity.search;

import com.xish.api.GeoLocation;

public class ActivitySearchCondition {

    private String uuid;
    private String appKey;
    private String appVCode;
    private String appVName;
    private String channel;
    private String fieldsVersion;
    private String format;
    private String free;
    private String genreId;
    private String isNear;
    private String isValid;
    private String keyword;
    private String lat;
    private String lon;
    private String limitedDiscount;
    private String method;
    private String offset;
    private String os;
    private String pagesize;
    private String poiId;
    private String r;
    private String tag;
    private String timestamp;
    private String topicSession;
    private String v;

    private int cityPoiId;

    public boolean hasKeyword() {
        return !keyword.isEmpty();
    }

    public boolean hasGenre() {
        return !genreId.equals("0");
    }

    public boolean hasPoi() {
        return !poiId.equals("0");
    }

    public boolean hasFree() {
        return !free.equals("0");
    }

    public boolean hasLimitedDiscouont() {
        return !limitedDiscount.isEmpty();
    }

    public boolean hasTag() {
        return (tag != null) && !tag.isEmpty();
    }

    public boolean hasSpecialCondition() {
        //todo: 标签, 参加时间, 非默认排序
        return hasKeyword() || hasGenre() || hasTag()
                || hasPoi() || hasFree() || hasLimitedDiscouont();
    }

    public boolean hasGeoLocation() {
        return !lat.isEmpty() && !lon.isEmpty();
    }

    public GeoLocation getGeoLocation() {
        if (hasGeoLocation()) {
            GeoLocation geoLocation = new GeoLocation();
            geoLocation.setLatitude(Double.valueOf(lat));
            geoLocation.setLongitude(Double.valueOf(lon));

            return geoLocation;
        }

        return null;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public String getAppVCode() {
        return appVCode;
    }

    public void setAppVCode(String appVCode) {
        this.appVCode = appVCode;
    }

    public String getAppVName() {
        return appVName;
    }

    public void setAppVName(String appVName) {
        this.appVName = appVName;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getFieldsVersion() {
        return fieldsVersion;
    }

    public void setFieldsVersion(String fieldsVersion) {
        this.fieldsVersion = fieldsVersion;
    }

    public String getFormat() {
        return format;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public String getFree() {
        return free;
    }

    public void setFree(String free) {
        this.free = free;
    }

    public String getGenreId() {
        return genreId;
    }

    public void setGenreId(String genreId) {
        this.genreId = genreId;
    }

    public String getIsNear() {
        return isNear;
    }

    public void setIsNear(String isNear) {
        this.isNear = isNear;
    }

    public String getIsValid() {
        return isValid;
    }

    public void setIsValid(String isValid) {
        this.isValid = isValid;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getLon() {
        return lon;
    }

    public void setLon(String lon) {
        this.lon = lon;
    }

    public String getLimitedDiscount() {
        return limitedDiscount;
    }

    public void setLimitedDiscount(String limitedDiscount) {
        this.limitedDiscount = limitedDiscount;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getOffset() {
        return offset;
    }

    public void setOffset(String offset) {
        this.offset = offset;
    }

    public String getOs() {
        return os;
    }

    public void setOs(String os) {
        this.os = os;
    }

    public String getPagesize() {
        return pagesize;
    }

    public void setPagesize(String pagesize) {
        this.pagesize = pagesize;
    }

    public String getPoiId() {
        return poiId;
    }

    public void setPoiId(String poiId) {
        this.poiId = poiId;
    }

    public String getR() {
        return r;
    }

    public void setR(String r) {
        this.r = r;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getTopicSession() {
        return topicSession;
    }

    public void setTopicSession(String topicSession) {
        this.topicSession = topicSession;
    }

    public String getV() {
        return v;
    }

    public void setV(String v) {
        this.v = v;
    }

    public int getCityPoiId() {
        return cityPoiId;
    }

    public void setCityPoiId(int cityPoiId) {
        this.cityPoiId = cityPoiId;
    }
}
